package org.kuaishou.test;

import io.github.bonigarcia.wdm.WebDriverManager;
import org.junit.Test;

import java.util.ArrayList;

public class DownloadWebDriver {


    @Test
    public void setupClass() {
//        WebDriverManager webDriver = WebDriverManager.chromedriver();
//        WebDriverManager webDriver = WebDriverManager.edgedriver();
//        WebDriverManager webDriver = WebDriverManager.operadriver();
//        WebDriverManager webDriver = WebDriverManager.firefoxdriver();

        ArrayList<WebDriverManager> list = new ArrayList<>();
        list.add(WebDriverManager.chromedriver());
        list.add(WebDriverManager.edgedriver());
//        list.add(WebDriverManager.operadriver());
//        list.add(WebDriverManager.firefoxdriver());
        for (WebDriverManager webDriver : list) {
            try {
                webDriver.setup();
                String downloadedDriverPath = webDriver.getDownloadedDriverPath();
                System.out.println(downloadedDriverPath);
                //FileUtils.copyFileToDirectory(new File(downloadedDriverPath), new File(Config.WEBDRIVER_PATH));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

}
